package com.hangzhou.welbeing.welbeinginstrument.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;

import com.hangzhou.welbeing.welbeinginstrument.R;
import com.hangzhou.welbeing.welbeinginstrument.adapter.MessageAdapter;
import com.hangzhou.welbeing.welbeinginstrument.inteface.OnRecyclerViewItemClickListener;
import com.hangzhou.welbeing.welbeinginstrument.utils.Utils;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 时间 2017 年 09 月 11.
 * 作者 Administrator  刘传华
 * 公司 杭州惟君医疗科技有限公司
 * 包名 com.hangzhou.welbeing.pregnant.welbeing_pregnant.activity
 * 工程名 welbeing_pregnant
 */
public class MessageActivity extends Activity {
    @Bind(R.id.activity_message_iv_return)
    ImageView activityMessageIvReturn;
    @Bind(R.id.activity_message_recyclerView)
    RecyclerView activityMessageRecyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_message);
        ButterKnife.bind(this);

        Utils.setStatusBar(this,false,false);
        Utils.setStatusTextColor(true,this);

        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        activityMessageRecyclerView.setLayoutManager(layoutManager);
        MessageAdapter messageAdapter  = new MessageAdapter();
        activityMessageRecyclerView.setAdapter(messageAdapter);
        messageAdapter.setOnItemClickListener(new OnRecyclerViewItemClickListener() {
            @Override
            public void onItemClick(View view) {
                int position = activityMessageRecyclerView.getChildAdapterPosition(view);
                switch (position){
                   /* case 0:  //私信  DirectMessages
                        Intent intent =  new Intent(MessageActivity.this,DirectMessagesActivity.class);
                        startActivity(intent);
                        break;*/
                    case 0:  //收到的赞 ReceivedPraise
                        Intent intent1 =  new Intent(MessageActivity.this,ReceivedPraiseActivity.class);
                        startActivity(intent1);
                        break;
                    case 1:  //收到的评论  ReceivedComments
                        Intent intent2=  new Intent(MessageActivity.this,ReceivedCommentsActivity.class);
                        startActivity(intent2);
                        break;
                    case 2:  //新增关注  NewFocus
                        Intent intent3=  new Intent(MessageActivity.this,NewFocusActivity.class);
                        startActivity(intent3);
                        break;
                }
            }

            @Override
            public void onItemFirstButtonClick(View v, int position) {

            }
        });
    }

    @OnClick(R.id.activity_message_iv_return)
    public void onViewClicked() {
        finish();
    }
}
